<?php
/**
 * The following variables are available in this template:
 * - $this: the BootstrapCode object
 */
?>
<?php echo "<?php\n"; ?>
/* @var $this <?php echo $this->getControllerClass(); ?> */
/* @var $model <?php echo $this->getModelClass(); ?> */
/* @var $form BSActiveForm */
<?php echo "?>\n"; ?>

<?php 
echo "<?php\n";
echo 'BSHtml::$formLayoutHorizontalLabelClass = \'col-lg-3\';';
echo "\n";
echo 'BSHtml::$formLayoutHorizontalControlClass = \'col-lg-6\';';
echo "\n";
echo "?>"
?>

<?php echo "<?php \$form=\$this->beginWidget('bootstrap.widgets.BsActiveForm', [
	'id'=>'" . $this->class2id($this->modelClass) . "-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
	'layout' => BSHtml::FORM_LAYOUT_HORIZONTAL,
	'htmlOptions'=>['class'=>'row-border'],
]); ?>\n"; ?>

<div class="row">
	<div class="col-lg-12">
		<div class="panel panel-midnightblue">
			<div class="panel-heading">
				<h4>表单元素</h4>
			</div>
			<div class="panel-body">
				<div class="form">
					
				    <p class="help-block" style="margin-bottom:20px"><span class="required">*</span> 为必填字段.</p>
				
				    <?php echo "<?php echo \$form->errorSummary(\$model); ?>\n"; ?>
				
				    <?php
				    foreach ($this->tableSchema->columns as $column) {
				        if ($column->autoIncrement) {
				            continue;
				        }
				        ?>
				        <?php echo "<?php echo " . $this->generateActiveControlGroup($this->modelClass, $column) . "; ?>\n"; ?>
				
				    <?php
				    }
				    ?>
				        
				
				</div><!-- form -->
			</div> <!-- end panel-body -->
			
			<div class="panel-footer">
	            <div class="row">
	                <div class="col-sm-6 col-sm-offset-3">
	                    <div class="btn-toolbar">
	                        <?php echo "<?php echo BSHtml::submitButton('提交', ['color' => BSHtml::BUTTON_COLOR_PRIMARY]); ?>\n"; ?>
						    <a class="btn btn-default" href="<?php echo '<?php echo $this->createUrl(\'admin\')?>'?>">取消</a>
	                    </div>
	                </div>
	            </div>
	        </div>
			
		</div>
	</div>
</div> <!-- end row -->
<?php echo '<?php $this->endWidget()?>'?>